<?php

namespace app\teacher\controller\course;

use app\common\controller\Frontend;
use app\common\service\course\LexiconService;
use app\common\model\banxi\core\CoreMyLexicon as CoreMyLexiconModel;
use think\facade\Log;

/*
 * 阅读理解
 * */
class Lexicon extends Frontend
{
    protected array $noNeedLogin = [''];

    protected array $noNeedPermission = ['*'];

    public function initialize(): void
    {
        parent::initialize();
    }

    /*
     * 查询-阅读记录信息
     * */
    public function getSkRecordFirstLetterWords()
    {
        $skRecordId = $this->request->get('skRecordId');

        $LexiconService = new LexiconService();
        $list = $LexiconService->getSkRecordFirstLetterWordsData($skRecordId);

        $this->ok('操作成功',$list);
    }

    /*
     * 查询-课程单词（首字母模式）
     * */
    public function listLexiconByCourseId()
    {
        $courseId = $this->request->get('courseId');
        $studentId = $this->request->get('studentId');

        if (!$courseId){
            $this->error('参数错误');
        }
        $LexiconService = new LexiconService();
        $list = $LexiconService->listFirstLetterStructureByCourse($courseId, $studentId);

        $this->ok('操作成功',$list);
    }

}